/*
 * @Author: your name
 * @Date: 2025-04-07 14:36:21
 * @LastEditors: your name
 * @LastEditTime: 2025-07-30 13:50:22
 * @Description: 
 * @FilePath: \RuoYi-Vue3\src\api\cloudTv\api.js
 */

import request from '@/utils/request'

/************************  企业管理  ****************************/ 
export const stationlist = (data) => {
  return request({
    url: '/dianli/ent/ent-station/list',
    headers: {
      isToken: false
    },
    method: 'post',
    params:data,
    data: {}
  })
}
export const wholeStruct = (data) => {
  return request({
    url: '/dianli/ent/ent-station/wholeStruct',
    headers: {
      isToken: false
    },
    method: 'post',
    params:data,
    data: {}
  })
}
export const getById = (data) => {
  return request({
    url: `/dianli/ent/ent-station/webConfig/getById/${data}`,
    headers: {
      isToken: false
    },
    method: 'get',
  })
}

/************************  企业列表  ****************************/ 
// 添加公司
export const AddEnterPrise = (data) => {
  return request({
    url: '/api/YDWSEnterprise/AddEnterPrise',
    method: 'post',
    data:data
  })
}

// 删除公司
export const DelStationPrise = (data) => {
  return request({
    url: '/api/YDWSEnterprise/DelStation',
    method: 'post',
    data:data
  })
}

// 修改公司
export const EditEnterPrise = (data) => {
  return request({
    url: '/api/YDWSEnterprise/EditEnterPrise',
    method: 'post',
    data:data
  })
}

// 查询公司
export const GetEnterpriseList = (data) => {
  return request({
    url: '/api/YDWSEnterprise/GetEnterpriseList',
    method: 'post',
    data:data
  })
}

// 分页查询公司
export const GetEnterprisePageList = (data) => {
  return request({
    url: '/api/YDWSEnterprise/GetEnterprisePageList',
    method: 'post',
    data:data
  })
}

/************************  监测站点操作  ****************************/ 

// 添加监测站点
export const AddStation = (data) => {
  return request({
    url: '/api/YDWSStation/AddStation',
    method: 'post',
    data:data
  })
}

// 删除监测站点
export const DelStation = (data) => {
  return request({
    url: '/api/YDWSStation/DelStation',
    method: 'post',
    data:data
  })
}

// 修改监测站点
export const EditStation = (data) => {
  return request({
    url: '/api/YDWSStation/EditStation',
    method: 'post',
    data:data
  })
}

// 查询监测站点
export const GetStationList = (data) => {
  return request({
    url: '/api/YDWSStation/GetStationList',
    method: 'post',
    data:data
  })
}

// 分页查询监测站点
export const GetStationPageList = (data) => {
  return request({
    url: '/api/YDWSStation/GetStationPageList',
    method: 'post',
    data:data
  })
}

/************************  设备管理  ****************************/ 

// 添加设备
export const AddDevice = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/AddDevice',
    method: 'post',
    data:data
  })
}

// 删除设备
export const DelDevice = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/DelDevice',
    method: 'post',
    data:data
  })
}

// 修改设备
export const EditDevice = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/EditDevice',
    method: 'post',
    data:data
  })
}

// 查询设备
export const GetDeviceList = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/GetDeviceList',
    method: 'post',
    data:data
  })
}

// 查询设备
export const GetDevicePageList = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/GetDevicePageList',
    method: 'post',
    data:data
  })
}

// 添加传感器
export const AddSenser = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/AddSenser',
    method: 'post',
    data:data
  })
}

// 删除传感器
export const DelSenser = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/DelSenser',
    method: 'post',
    data:data
  })
}

// 修改传感器
export const EditSenser = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/EditSenser',
    method: 'post',
    data:data
  })
}

// 查询传感器
export const GetSenserList = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/GetSenserList',
    method: 'post',
    data:data
  })
}

// 查询传感器
export const GetSenserPageList = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/GetSenserPageList',
    method: 'post',
    data:data
  })
}

// 查询设备配置
export const GetDevCFG = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/GetDevCFG',
    method: 'post',
    data:data
  })
}

// 修改设备配置
export const UpDateDevCFG = (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/UpDateDevCFG',
    method: 'post',
    data:data
  })
}

/************************  线路管理  ****************************/ 

// 添加主线
export const AddMasterLine = (data) => {
  return request({
    url: '/api/YDWS_Line/AddMasterLine',
    method: 'post',
    data:data
  })
}

// 删除主线
export const DelMasterLine= (data) => {
  return request({
    url: '/api/YDWS_Line/DelMasterLine',
    method: 'post',
    data:data
  })
}

// 修改主线
export const EditMasterLine= (data) => {
  return request({
    url: '/api/YDWS_Line/EditMasterLine',
    method: 'post',
    data:data
  })
}

// 分页查询主线
export const GetMasterLinePageList= (data) => {
  return request({
    url: '/api/YDWS_Line/GetMasterLinePageList',
    method: 'post',
    data:data
  })
}

// 分页查询主线
export const GetMasterLineDetailsPageList= (data) => {
  return request({
    url: '/api/YDWS_Line/GetMasterLineDetailsPageList',
    method: 'post',
    data:data
  })
}

// 查询主线
export const GetMasterLineList= (data) => {
  return request({
    url: '/api/YDWS_Line/GetMasterLineList',
    method: 'post',
    data:data
  })
}

// 添加支线
export const AddBranchLine= (data) => {
  return request({
    url: '/api/YDWS_Line/AddBranchLine',
    method: 'post',
    data:data
  })
}

// 删除支线
export const DelBranchLine= (data) => {
  return request({
    url: '/api/YDWS_Line/DelBranchLine',
    method: 'post',
    data:data
  })
}

// 修改支线
export const EditBranchLine= (data) => {
  return request({
    url: '/api/YDWS_Line/EditBranchLine',
    method: 'post',
    data:data
  })
}

// 查询支线
export const GetBranchLineList= (data) => {
  return request({
    url: '/api/YDWS_Line/GetBranchLineList',
    method: 'post',
    data:data
  })
}

// 分页查询支线
export const GetBranchLinePageList= (data) => {
  return request({
    url: '/api/YDWS_Line/GetBranchLinePageList',
    method: 'post',
    data:data
  })
}

/************************  监测站点配置管理  ****************************/ 

// 添加监测站点配置信息
export const AddStationCFG= (data) => {
  return request({
    url: '/api/YDWSStation/AddStationCFG',
    method: 'post',
    data:data
  })
}

// 删除监测站点配置信息
export const DelStationCFG= (data) => {
  return request({
    url: '/api/YDWSStation/DelStationCFG',
    method: 'post',
    data:data
  })
}

// 修改监测站点配置信息
export const EditStationCFG= (data) => {
  return request({
    url: '/api/YDWSStation/EditStationCFG',
    method: 'post',
    data:data
  })
}

// 查询监测站点配置信息
export const GetStationCFGList= (data) => {
  return request({
    url: '/api/YDWSStation/GetStationCFGList',
    method: 'post',
    data:data
  })
}

// 根据查询监测站点配置信息
export const GetStationByStation= (data) => {
  return request({
    url: '/api/YDWSStation/GetStationByStation',
    method: 'post',
    data:data
  })
} 

// 分页查询监测站点配置信息
export const GetStationCFGPageList= (data) => {
  return request({
    url: '/api/YDWSStation/GetStationCFGPageList',
    method: 'post',
    data:data
  })
} 

// 总览数据
export const GetStationDevLineCfg= (data) => {
  return request({
    url: '/api/YDWSStation/GetStationDevLineCfg',
    method: 'post',
    data:data
  })
} 

/************************  固件操作接口  **********/ 

// 下载固件
export const DownFirmware= (query) => {
  return request({
    url: '/api/Upload/DownFirmware',
    method: 'get',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    responseType: 'blob'  // 非常重要，确保返回的是 Blob 类型 
  })
} 

// 添加新固件
export const AddVersion820= (data) => {
  return request({
    url: '/api/FirmWaveVersion/AddVersion820',
    method: 'post',
    data:data
  })
} 

// 删除固件
export const DelVersion= (data) => {
  return request({
    url: '/api/FirmWaveVersion/DelVersion',
    method: 'post',
    data:data
  })
} 

// 修改固件
export const EditVersion= (data) => {
  return request({
    url: '/api/FirmWaveVersion/EditVersion',
    method: 'post',
    data:data
  })
} 

// 查询固件
export const GetVersionList= (data) => {
  return request({
    url: '/api/FirmWaveVersion/GetVersionList',
    method: 'post',
    data:data
  })
} 

// 查询分页固件
export const GetVersionPageList= (data) => {
  return request({
    url: '/api/FirmWaveVersion/GetVersionPageList',
    method: 'post',
    data:data
  })
} 

/************************  告警管理  **********/ 

// 查询分页 接地信息
export const ShowAlarmGndPage= (data) => {
  return request({
    url: '/api/MQTTChannel/ShowAlarmGndPage',
    method: 'post',
    data:data
  })
} 

// 查询单个 接地信息
export const FindOneAlarmGnd= (data) => {
  return request({
    url: '/api/MQTTChannel/FindOneAlarmGnd',
    method: 'post',
    data:data
  })
} 

// 查询分页 电压信息
export const ShowAlarmModPage= (data) => {
  return request({
    url: '/api/MQTTChannel/ShowAlarmModPage',
    method: 'post',
    data:data
  })
} 

// 查询单个 电压信息
export const FindOneAlarm= (data) => {
  return request({
    url: '/api/MQTTChannel/FindOneAlarm',
    method: 'post',
    data:data
  })
} 

// 查询单个 接地已读已处理
export const UpdateGndState= (data) => {
  return request({
    url: '/api/MQTTChannel/UpdateGndState',
    method: 'post',
    data:data
  })
} 

// 查询单个 电压已读已处理
export const UpdateVotaState= (data) => {
  return request({
    url: '/api/MQTTChannel/UpdateVotaState',
    method: 'post',
    data:data
  })
} 

// 删除 接地信息
export const DeleteGndState= (data) => {
  return request({
    url: '/api/MQTTChannel/DeleteGndState',
    method: 'post',
    data:data
  })
} 

// 删除 电压信息
export const DelVotaState= (data) => {
  return request({
    url: '/api/MQTTChannel/DelVotaState',
    method: 'post',
    data:data
  })
} 

// 发送配置信息到设备
export const GetSendConfigToDevice= (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/GetSendConfigToDevice',
    method: 'post',
    data:data
  })
} 

// 发送配置信息到设备
export const AddDevAndSen= (data) => {
  return request({
    url: '/api/YDWS_Dev_Senser/AddDevAndSen',
    method: 'post',
    data:data
  })
} 
// 获取终端标识
export function GetIndentityMark(data) {
  return request({
    url: '/api/Authorization/GetIndentityMark',
    headers: {
      isToken: false
    },
    method: 'get',
    data: data
  })
}
// 查询设备是否可升级
export function CheckFireWare(data) {
  return request({
    url: '/api/YDWS_Dev_Senser/CheckFireWare',
    method: 'post',
    data:data
  })
}

// 设备升级指令
export function SendFireWareToDevice(data) {
  return request({
    url: '/api/MQTTChannel/SendFireWareToDevice',
    method: 'post',
    data:data
  })
}

// 设备升级指令
export function GetCanlistConfigToDevice(data) {
  return request({
    url: '/api/YDWS_Dev_Senser/GetCanlistConfigToDevice',
    method: 'post',
    data:data
  })
}